Socket
Socket
Sign inDemoInstall

@toruslabs/http-helpers

Package Overview
Dependencies
5
Maintainers
4
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @toruslabs/http-helpers

http helpers


Version published
Weekly downloads
77K
decreased by-4.12%
Maintainers
4
Install size
912 kB
Created
Weekly downloads
 

Readme

Source

Http helpers

npm version npm

Introduction

  • This package allows you to call http methods with pre defined configs. Uses fetch or node-fetch internally
  • Adds support for api keys
  • Works in both browser and node.js environments

Installation

Bundling

This module is distributed in 4 formats

  • esm build dist/httpHelpers.esm.js in es6 format
  • commonjs build dist/httpHelpers.cjs.js in es5 format
  • umd build dist/httpHelpers.umd.min.js in es5 format without polyfilling corejs minified
  • node build dist/httpHelpers-node.js in es5 format

By default, the appropriate format is used for your specified usecase You can use a different format (if you know what you're doing eg. node) by referencing the correct file

The cjs build is not polyfilled with core-js. It is upto the user to polyfill based on the browserlist they target

Directly in Browser

CDN's serve the non-core-js polyfilled version by default. You can use a different

jsdeliver

<script src="https://cdn.jsdelivr.net/npm/@toruslabs/http-helpers"></script>

unpkg

<script src="https://unpkg.com/@toruslabs/http-helpers"></script>

Usage

Add @toruslabs/http-helpers to your project:

import { get, post } from "@toruslabs/http-helpers";
const { get, post } = require("@toruslabs/http-helpers").default;
// For Node.js
const { get, post } = require("@toruslabs/http-helpers/dist/httpHelpers-node.js").default;

Requirements

  • This package requires a peer dependency of @babel/runtime
  • Node 14+

Keywords

FAQs

Last updated on 28 Apr 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc